package nGui.controls.containers;

import nGui.controls.Control;

class VBox extends Control
{
	public var alignment(null,setAlignment) : String;
	public var gap(null,setGap) : Int;
	public var margin(null,setMargin) : Int;

	public function new()
	{
		super();
		__c = ngui_element_vbox();
	}

	public function appendChild( child : Control )
	{
		ngui_append_element( __c, child.__c );
	}

	// LEFT, CENTER or RIGHT
	private function setAlignment( val : String )
	{
		setAttribute( "ALIGNMENT", val );
		return null;
	}
	
	private function setGap( val : Int )
	{
		setAttribute( "GAP", Std.string( val ) );
		return null;
	}
	
	private function setMargin( val : Int )
	{
		setAttribute( "MARGIN", Std.string( val ) );
		return null;
	}
	
	static var ngui_element_vbox = neko.Lib.load("nGui","ngui_element_vbox",0);
	static var ngui_append_element = neko.Lib.load("nGui","ngui_append_element",2);
}